package com.suixinsanren.design.compound.study.demo04;

import java.util.ArrayList;
import java.util.Iterator;

public class Flock implements Quackable {

    private ArrayList<Quackable> quackers = new ArrayList<>();

    public void add(Quackable quacker) {
        quackers.add(quacker);
    }


    @Override
    public void quack() {
        quackers.forEach(Quackable::quack);
    }
}
